$(function () {
    // alert(11)
    $('.el-form').on('submit', function (e) {
        e.preventDefault()
        $.ajax({
            method: 'post',
            url: 'http://121.4.102.44:8083/employee/login',
            contentType: "application/json",
            data: JSON.stringify({
                username: $('[type="text"]').val().trim(),
                password: $('[type="password"]').val().trim()
            }),
            success(res) {
                console.log(res);
                if (res.code !== 1) {
                    return layui.layer.msg(res.msg, { icon: 5 })
                }
                layui.layer.msg('登陆成功', { icon: 6, time: 1000 }, function () {
                    location.href = 'index.html'
                })

            }

        })
    })
})